package com.ilink.teacherservice.service;


import com.ilink.ilinkcommon.domain.R;
import com.ilink.ilinkcommon.domain.PO.studyservice.CourseSource;
import com.ilink.ilinkcommon.domain.PO.studyservice.StudyFileSource;
import java.io.File;
import java.util.Map;
import org.springframework.web.multipart.MultipartFile;

/**
* <h3>new-ilink-java-backend</h3>
* @Description
* <p>基于线程池的流量控制和排队队列，用于提供资源的上传和加工</p>
* @Author pengshiyao
* @Date 2024-09-16 13:43
**/

public interface FileSourceHandleThreadService {

    //1.上传文档至OSS和百炼及转写生成加工
    R uploadFileTask(MultipartFile file, Long courseFileId, Long courseId, Integer sortOrder);

    // 处理文件上传MultipartFile file
    void processFileUpload(File file, String filePath, String newFilename,
        StudyFileSource courseSource);

    //RAG加工和百炼上传加工MultipartFile file,
    void processFileHandle(File file, StudyFileSource fileSource, String filePath,
        String newFilename, Long courseId);

    //2.上传音视频

    R uploadSourceTask(MultipartFile file, Long courseFileId, String language, Boolean isTranslated,
        String speakerType, Long courseid, Integer sortOrder);

    //处理音视频上传和加工
    void processSourceUpload(File file, String filePath, String newFilename,
        CourseSource courseSource);

    // 工具：判断是否排队已满
    Map<String, Boolean> checkRateLimiterStatus();
}
